<?php 
require_once('nav.php');
$sql="select t1.*,t2.typename from videos t1 left join videotype t2 on t1.tid=t2.tid";
$result=fetch_array($sql);
//var_dump($result);
 ?>
 <div class="col-sm-9 col-md-18">
 	<table class="table table-hover">
 		<tr>
 			<th>序号</th><th>名称</th><th>操作</th>
 		</tr>
 		
 			<?php 
 			foreach($result as $index=>$row)
 			{   
 				//echo '<tr><td>{$index++}</td></tr> $row['videoname']'
 				?>
            <tr>
            	<td><?php echo $index+1; ?></td>
            	<td><?php  echo $row['videoname']; ?></td>
            	<td>
            	<a href= "vtEditFrom.php?id=<?php echo $row['vid'];?>" class="btn btn-primary">修改</a>
            	<a href= "vtDelete.php?id=<?php echo $row['vid']; ?>"class="btn btn-warning" onClick="return confirm('确定删除吗？');">删除</a>
            	</td>
            </tr>




 			<?php
 			}
 			 ?>
 			
 		
 	</table>
 </div>
 <?php 
 require_once('footer.php');
  ?>